
*********************************;
* PROGRAM: Angrist1995_Table3	 ;
* PROGRAMMER: Simone Schaner	 ;
* PURPOSE: Recreates Table 3 of	 ;
*	Angrist (1995)				 ;
* DATE CREATED: 10/09/07		 ;
*********************************;

libname d '/bbkinghome/sschaner/Angrist Work/Web Papers/Angrist_1995/';

data one;
	set d.data8191;

	/*RESTRICTIONS*/
	if (workloc='WBANK' or workloc='GAZA' or workloc='JLEM'
		or workloc='ISRAEL');
	if educ ne .;
	
	workisrl= (workloc='JLEM' or workloc='ISRAEL');
		 if workloc="" then workisrl=.;
	
	ed12= educ=12;
	ed13_15= (13 le educ le 15);
	ed16plus= educ ge 16;
	
	age25_34= 25 le age le 34;
	age35_44= 35 le age le 44;
	age45_54= 45 le age le 54;
	age55_64= 55 le age le 64;
	
	occ02= 0 le occ le 29;
	occ35= 30 le occ le 59;
	occ6= 60 le occ le 69;
	occ78= 70 le occ le 89;
	occ9= 90 le occ le 99;
	
	gazan= region='GAZA';
	djlem=workloc='JLEM';
	camp= sample=3;
	city= sample=1;
	ind= int(ind/10);
	indgroup=0;
		if 1 le ind le 3 then indgroup=1;
		if ind=4 then indgroup=4;
		if ind ge 5 then indgroup=5;
		if ind=8 then indgroup=8;
		
	occ=int(occ/10);
		if 0 le occ le 2 then occgroup=0;
		if 3 le occ le 5 then occgroup=3;
		if occ=6 then occgroup=6;
		if 7 le occ le 8 then occgroup=7;
		if occ=9 then occgroup=9;
		
	if wrkdays>0 then hrsday= 4.35*(hourslw/wrkdays);
	**> if mnthwage<15000;
	if (hrsday>0 and daywage>0) then lnhour=log(daywage)-log(hrsday);
	if mnthwage gt 0 then lnmnth=log(mnthwage);
	if daywage gt 0 then lnday=log(daywage);
	
	keep v36 date educ age year wrkdays hourslw lnmnth lnday mnthwage daywage workisrl ed13_15 ed16plus
		indgroup occgroup ed12 djlem gazan camp city workloc age25_34 age35_44 age45_54 age55_64 
		occ02 occ35 occ6 occ78 occ9;
		
data two;
	set one;
	potex=age-educ-6;
	potex2=potex**2;
	run;
proc sort data=two;
by data year;
run;

proc glm data=two;
	title1 'Weight regression: men working in israel, jlem, wbank, gaza';
	weight v36;
	class date year workisrl;
	model lnday = date year*age25_34 year*age35_44 year*age45_54 year*age55_64 
		year*workisrl year*camp year*gazan year*city djlem year*workisrl*ed13_15 year*workisrl*ed16plus/ss3 solution;
	where date ne 91;
	contrast 'test ed 16 plus is different' ed16plus*year*workisrl -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,
										ed16plus*year*workisrl 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,
										ed16plus*year*workisrl 0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,
	                                    ed16plus*year*workisrl 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0,
	                                    ed16plus*year*workisrl 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0,
	                                    ed16plus*year*workisrl 0 0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0,
	                                    ed16plus*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0,
	                                    ed16plus*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0,
	                                    ed16plus*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0,
	                                    ed16plus*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 0 0,
	                                    ed16plus*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1;
	contrast 'test ed 15-15 is different' ed13_15*year*workisrl -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,
										ed13_15*year*workisrl 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,
										ed13_15*year*workisrl 0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0,
	                                    ed13_15*year*workisrl 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0,
	                                    ed13_15*year*workisrl 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0 0 0,
	                                    ed13_15*year*workisrl 0 0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0 0 0,
	                                    ed13_15*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0 0 0,
	                                    ed13_15*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0 0 0,
	                                    ed13_15*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 0 0 0 0,
	                                    ed13_15*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1 0 0,
	                                    ed13_15*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1 1;
	estimate 'ed1381'                   ed13_15*year*workisrl 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
	estimate 'ed1382'					ed13_15*year*workisrl 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
	estimate 'ed1383'					ed13_15*year*workisrl 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
	estimate 'ed1384'                   ed13_15*year*workisrl 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
	estimate 'ed1385'                   ed13_15*year*workisrl 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0;
	estimate 'ed1386'                   ed13_15*year*workisrl 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0;
	estimate 'ed1387'                   ed13_15*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0;
	estimate 'ed1388'                   ed13_15*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0;
	estimate 'ed1389'                   ed13_15*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0;
	estimate 'ed1390'                   ed13_15*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0;
	estimate 'ed1391'                   ed13_15*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1;
	estimate 'ed1681'                   ed16plus*year*workisrl 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
	estimate 'ed1682'					ed16plus*year*workisrl 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
	estimate 'ed1683'					ed16plus*year*workisrl 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
	estimate 'ed1684'                   ed16plus*year*workisrl 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
	estimate 'ed1685'                   ed16plus*year*workisrl 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0 0 0;
	estimate 'ed1686'                   ed16plus*year*workisrl 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0 0 0;
	estimate 'ed1687'                   ed16plus*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 0;
	estimate 'ed1688'                   ed16plus*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0;
	estimate 'ed1689'                   ed16plus*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0 0 0;
	estimate 'ed1690'                   ed16plus*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1 0 0;
	estimate 'ed1691'                   ed16plus*year*workisrl 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 -1;
	run;